body{
    margin: 0;
    background-color:green;
    position: relative;
    height: 100vh;
}
.container{
    width: 232px;
    height: 100px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    font-size: 0;/*取消空格*/
}
.ball{
    width: 100px;
    height: 100px;
    border: 8px solid #000;
    display: inline-block;
    border-radius: 50%;
    background-color: white;
    position: relative;
}
#l-ball{ /*加入动画  持续时间     时间            延迟        次数     方向       执行模式*/
    /*animation: name duration timing-function delay iteration-count direction fill-mode;*/
    animation: close 4s ease infinite/*循环*/;
    z-index: 1;
}
#r-ball{
    animation: kiss 4s ease infinite;
}
.face{
    width: 70px;
    height: 30px;
    /*border: 1px solid #000;*/
    position: absolute;
    right: 0px;
    top: 30px;
}
.face-l{
    animation: face 4s ease infinite;
}
.face::before{ /*伪元素*/
    content: "";/*必要属性*/
    width: 18px;
    height: 8px;
    border-radius: 50%;
    background-color: green;
    position: absolute;
    right: -8px;
    top: 20px;
    
}
.face::after{
    content: "";/*必要属性*/
    width: 18px;
    height: 8px;
    border-radius: 50%;
    background-color: green;
    position: absolute;
    left: -5px;
    top: 20px;
   
}

.eye{
    width: 15px;
    height: 14px;
    border-bottom: 5px solid #000;
    border-radius: 50%;
    position: absolute;
}
.eye-l{
    left: 10px;
}
.eye-r{
   right: 5px;
}

.mouth{
    width: 30px;
    height: 14px;
    border-radius: 50%;
    border-bottom: 5px solid #000;
    position: absolute;
    left: 0;
    right: 0;
    margin:0 auto ;/*4个元素left top right bottom auto自适应*/
    bottom: -5px;
}


@keyframes close{   /*定义动画*/
    
    0%{
        transform: translate(0);
    }
    20%{
        transform: translateX(20px);
    }
    35%{
        transform: translateX(20px);
    }
    55%{
        transform: translateX(0px);
    }
    100%{
        transform: translateX(0px);
    }
}  @keyframes face{
    0%{
        transform: translate(0) rotate(0);
    }
    10%{
        transform: translate(0) rotate(0);
    }
    20%{
        transform: translate(5px) rotate(-2deg);
    }
    28%{
        transform: translate(0) rotate(0);/*rotato 默认绕Z轴转动*/
    }
    35%{
        transform: translate(5px) rotate(-2deg);
    }
    50%{
        transform: translate(0) rotate(0);
    }
    100%{
        transform: translate(0) rotate(0);
    }
}
.face-r{
    left: 0px;
    top: 37px;
}
.face-r::before{
    width: 10px;
    height: 10px;
    right: -4px;
}
.face-r::after{
    width: 10px;
    height: 10px;
    left: 5px;
}
.eyes-p{
    border-top: 5px solid #000;
    border-bottom:none;/*去掉*/
}
.kissm{
    position: absolute;
    left: 20px;
    top: 22px;
    opacity: 0;/*透明度*/
    animation: kissm 4s ease infinite;
}


.kiss{
    width: 13px;
    height: 10px;
    border-radius: 50%;
    border-left:5px solid #000 ;
}

@keyframes kiss{
    40%{
        transform: translate(0);
    }
    50%{
        transform: translate(30px) rotate(20deg);
    }
    60%{
        transform: translate(-33px);
    }
    67%{
        transform: translate(-33px);
    }
    77%{
        transform: translate(0);
    }
}
@keyframes kissm{
    0%{
        opacity: 0;
    }
    55%{
        opacity: 0;
    }
    55.1%{
        opacity: 1;
    }
    66%{
        opacity: 1;
    }
    66.1%{
        opacity: 0;
    }
}
@keyframes mouth-r{
    0%{
        opacity: 1;
    }
    55%{
        opacity: 1;
    }
    55.1%{
        opacity: 0;
    }
    66%{
        opacity: 0;
    }
    66.1%{
        opacity: 1;
    }
}
.mouth-r{
    animation:mouth-r 4s ease infinite ;
}